<?php echo $html->script(array("fckeditor.js","jquery.tablednd.js","jquery.validate.js")); ?>
<div class="breadcrumb">
    <ul id="breadcrumb">
        <li><a href="<?php echo Configure::read('base_url');?>backstage" title="Home">
		<?php echo $this->Html->image("home.png", array("alt" => "Home",'class'=>'home','border'=>'0'));?>
		</a></li>
                 <li><a href="<?php echo Configure::read('base_url');?>backstage/blogs" title="blogs">Posts</a></li>
        <li>Add Post</li>
    </ul>
</div>
<?php echo $this->element('admin/admin_leftmenu'); ?>
<div id="left">
    <?php echo $this->Session->flash(); ?>
	
    <div class="div_header"><?php __('Add Post'); ?></div>
    <div class="div_content">

		<?php echo $this->Form->create('Blog');
		//echo $this->Form->input('id');
		?>
		<table cellspacing="0" width="100%">
			<tbody>

                                <tr>
					<td colspan="2" align="left">
                                            Title:
						<?php
                                                
                                                echo $this->Form->input('Blog.title',array('type'=>'text','label'=>false, 'size'=>'118','style'=>"height:25px;",'class'=>'required'));
                                                ?>
					</td>
				</tr>

				<tr>
					<td colspan="2" align="left">
Description:
		<?php

                                                echo $form->textarea('Blog.description', array('cols' => '85', 'rows' => '15','class'=>'fckrequired'));?>
						<?php echo $fck->load('Blog.description', 'Custom');?>
					</td>
				</tr>
                                <tr>
					<td colspan="2" align="left">
                                            Blog Category:
						<?php
                                                echo $this->Form->input('blog_category_id',array('label'=>false));
                                                 ?>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="left">
			<input type="submit" class="button" name="button" id="button" value="Save" />
					</td>
				</tr>
			</tbody>
		</table>
        </form>

</div>
<div class="div_bottom"></div>
</div>
</div>

<script type="text/javascript">
    jQuery(document).ready(function(){

    jQuery.validator.addMethod("fckrequired", function (value, element) {
        var oEditor = FCKeditorAPI.GetInstance('ContactContacts') ;
        var pageValue = oEditor.GetHTML(true);
        pageValue=jQuery.trim(pageValue);
        if ( pageValue == "<br />" || pageValue == "") {
            return false;
        }else{
            return true;
        }
    }, "This field is required.");
    var v = jQuery("#BlogBackstageAddForm").validate({

                       });
});
</script>